function main()
{
  var layer = 0;
  var px = -1;
  var py = -1;
  var tx = -1;
  var ty = -1;

  do {
    px = Math.floor(ScreenToMapX(layer, GetMouseX()) / GetLayerScaleFactorX(layer));
    tx = Math.floor(px / GetTileWidth());
    py = Math.floor(ScreenToMapY(layer, GetMouseY()) / GetLayerScaleFactorY(layer));
    ty = Math.floor(py / GetTileHeight());

    if (tx >= 0 && ty >= 0 && tx < GetLayerWidth(layer) && ty < GetLayerHeight(layer)) {
      if (tx >= 0 && ty >= 0 && tx + 10 < GetLayerWidth(layer) && ty + 0 < GetLayerHeight(layer)) {
        var tile = GetTile(tx, ty, layer);
        SetTile(tx + 10, ty + 0, layer, tile);
      }
    }

  } while (IsMouseButtonPressed(MOUSE_LEFT));

  Abort("Tile: (" + tx + ", " + ty + ") Pixel: (" + px + ", " + py + ")");
}
